package com.bluesky.dreamer.common;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;

import com.sitech.biportal.util.ObjectUtil;
/**
 * 
 * @author handong
 *
 */
public class CommandFactory {
	static Log logger = LogFactory.getLog(CommandFactory.class);

	public static HttpCommand getHttpCommand(int cmd) {
		return getHttpCommand(getHttpCommandClass(cmd));
	}

	public static HttpCommand getHttpCommand(String cmdClass) {
		return (HttpCommand) ObjectUtil.getInstance(cmdClass);
	}

	protected static String getHttpCommandClass(int cmd) {
		// logger.debug("getHttpCommandClass(int) [cmd]" + cmd);
		String commandsFolder = "com.sitech.biportal.ana.commands.impl";
		String result = commandsFolder + ".";

		return result;
	}
}
